package com.antt.cn.test01.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.antt.cn.test01.utils.AntLog;


/**
 * Created by baichuan on 2017/4/11.
 * <h3>name:BaseFragment</h3>
 * Fragment is father class to provider any utils and base method<br/>
 *
 * @see Fragment
 * @see BaseInterface
 */

public abstract class BaseFragment extends Fragment implements BaseInterface {
    protected static String TAG = "";

    protected View root;

    public BaseFragment() {
        super();
        TAG = this.getClass().getName();
        AntLog.i(TAG, "fragment created");

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        root = inflater.inflate(getLayoutId(), null);
        initView();
        initData();
        initListener();
        return root;
    }

    /**
     * <div style="color:red">name:getLayoutId()</div>
     * <div>this method will getLayout id to this component</div>
     *
     * @return LayoutId
     */
    public abstract Integer getLayoutId();
}
